from base.base import Base
from selenium.webdriver.common.by import By
from time import sleep


class Qian_UI(Base):
    zhuce = (By.XPATH, '/html/body/div/div/div/header/section/div[1]/ul[2]/li/a[2]/span')
    nicheng = (By.XPATH, '/html/body/div/div/div/div[2]/div[2]/form/div[1]/div/div/div/input')
    mobile = (By.XPATH, '/html/body/div/div/div/div[2]/div[2]/form/div[2]/div/div/div/input')
    mima = (By.XPATH, '/html/body/div/div/div/div[2]/div[2]/form/div[4]/div/div[1]/div/input')
    zc_btn = (By.XPATH, '/html/body/div/div/div/div[2]/div[2]/form/div[5]/input')

    def register(self):
        self.click(*self.zhuce)
        self.send_keys(*self.nicheng, text='niiiii')
        sleep(1)
        self.send_keys(*self.mobile, text='1503790700')
        sleep(1)
        self.send_keys(*self.mima, text='123456')
        sleep(1)
        self.click(*self.zc_btn)

    denglu = (By.XPATH, '/html/body/div/div/div/header/section/div[1]/ul[2]/li/a[1]/span')
    shoujihao = (By.XPATH, '/html/body/div/div/div/div[2]/div[2]/form/div[1]/div/div/div/input')
    pwd = (By.XPATH, '/html/body/div/div/div/div[2]/div[2]/form/div[2]/div/div/div/input')
    dl_btn = (By.XPATH, '/html/body/div/div/div/div[2]/div[2]/form/div[3]/input')

    def login(self):
        self.click(*self.denglu)
        self.send_keys(*self.shoujihao, text='1503790700')
        self.send_keys(*self.pwd, text='123456')
        self.click(*self.dl_btn)